package com.yima.baseproj.module.app.tongzhi;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yima.baseproj.module.app.tongzhi.model.AppTongzhiAddOrEditParamModel;
import com.yima.baseproj.module.config.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@TableName("app_tongzhi")
public class AppTongzhiEntity extends BaseEntity {

  @ApiModelProperty(value = "标题")
  @TableField(value = "title")
  private String title;

  @ApiModelProperty(value = "内容类型。1.无。2.富文本。")
  @TableField(value = "content_type")
  private Integer contentType;

  @ApiModelProperty(value = "内容")
  @TableField(value = "content")
  private String content;

  @ApiModelProperty(value = "状态：1.展示；0.不展示")
  @TableField(value = "state")
  private Integer state;

  public void setData(AppTongzhiAddOrEditParamModel appTongzhiAddOrEditParamModel){
    this.title = appTongzhiAddOrEditParamModel.getTitle();
    this.contentType = appTongzhiAddOrEditParamModel.getContentType();
    this.content = appTongzhiAddOrEditParamModel.getContent();
    this.state = appTongzhiAddOrEditParamModel.getState();
  }
}